angular.module('app')
    /*.service('cache', ['$cookies', function ($cookies) {
        console.log(this);
        var obj = {
            name: 2
        }
        this.put = function (key, val) {
            $cookies.put(key, val);
        };
        this.get = function (key) {
            if (!$cookies.get(key)) return false;
            return $cookies.get(key);
        }
        this.remove = function (key) {
            if (!$cookies.get(key)) return false;
            return $cookies.remove(key);
        }


    }]);*/
    .factory('cache', ['$cookies', function ($cookies) {
        var obj = {
            name: 2
        }
        return {
            put: function (key, val) {
                console.log(key);
                $cookies.put(key, val);
            },
            get: function (key) {
                if (!$cookies.get(key)) return false;
                return $cookies.get(key);
            }
            ,
            remove: function (key) {
                if (!$cookies.get(key)) return false;
                return $cookies.remove(key);
            }
        }
    }]);
